//
//  CConfiguration.h
//  collection
//
//  Created by 张靖 on collection-1.
//  Copyright 2011年 collection. Inc.. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "CFileHandle.h"
#import "CMD5Util.h"

#define BUNDLEIMAGE(path) ([[CConfiguration sharedConfiguration] getBundleImage:path])

#define BUILD_VERSION 3

enum 
{
	kPathForDocument = 0,
	kPathForCache,
	kPathForBundle,
    kPathForFileCache,
    kPathForDBCache
};
typedef int TPathType;

@interface CConfiguration : NSObject
{
}

@property (nonatomic, retain) NSString* deviceToken;

+ (CConfiguration*) sharedConfiguration;
+ (void) purgeSharedConfiguration;

- (NSString*) getAppDocPath;
- (NSString*) getAppCachePath;
- (NSString*) getFullPath:(NSString*) filename pathtype:(TPathType)type;
- (NSString*) getPathByType:(TPathType)type;
- (UIImage*) getBundleImage:(NSString*)imagePath;

- (NSString*) getDateString:(NSString*)format date:(NSDate*)date;
- (NSString*) getDateNowString:(NSString*)format;

- (NSData*) readDataFromLocal:(NSString*)fileName;
- (void) saveDataToLocal:(NSString*)fileName data:(NSData*)data;

// 返回运营商名称
- (NSString*) getCellCarrierName;
- (NSString*) getUniqueID;

// push服务Token
- (NSString*) getDeviceToken;
- (void) setAndSaveDeviceToken:(NSString*)deviceToken;
- (void) readDeviceTokenFromLocal;

- (NSString*)filePath:(NSString*)fileName underUser:(NSString*)userID;
- (NSString*)filePath:(NSString*)fileName underUser:(NSString*)userID pathType:(TPathType)type;

- (NSString*)filePath:(NSString*)fileName underUser:(NSString*)userID underTrip:(long)tripID;
- (NSString*)filePath:(NSString*)fileName underUser:(NSString*)userID underTrip:(long)tripID pathType:(TPathType)type;

@end
